using CoreProject.IRepository;
using CoreProject.Model;
using System.Threading.Tasks;

namespace CoreProject.Repository
{
  internal class ImageRepoistory : BaseRepository<Image>, IImageRepoistory
  {
    private readonly EFDbContext context;

    public ImageRepoistory(EFDbContext context) : base(context)
    {
      this.context = context;
    }

    public async Task<Image> AddImage(Image image) {
      this.context.Set<Image>().Add(image);
      await this.context.SaveChangesAsync();
      return image; 
    }
  }
}
